1. Field of the Invention
The present invention relates to a non-volatile memory apparatus, a method for controlling a non-volatile memory apparatus, and a data storage medium that stores a program for controlling a non-volatile memory apparatus. More particularly, the present invention relates to a non-volatile memory apparatus that is capable of writing and reading data by designating a logic sector address thereof and has a relatively short preparation time between the time power is turned on and the time reading and writing operations can be performed, a method for controlling such a non-volatile memory apparatus and a data storage medium storing a program for controlling such non-volatile memory apparatus.
Also, the present invention relates to memory cards such as ATA (AT Attachment) cards, SSFDC (Solid State Floppy Disk Card forum) cards, and the like in which locations to store data are designated by a designation method similar to that used for hard disks and floppy disks, a method for controlling the memory cards, and a data storage medium that stores a program to control the memory cards.
Furthermore, the present invention relates to a non-volatile memory apparatus having a flash EEPROM (Electrically Erasable Programmable Read Only Memory) and a RAM (Random Access Memory). In one aspect, conversion tables for converting logic sector addresses (that are designated upon data reading and data writing) into physical page addresses in the flash EEPROM are divided and stored in the flash EEPROM and the RAM. The present invention also relates to a method for controlling the non-volatile memory apparatus, and a data storage medium that stores a program to control the non-volatile memory apparatus.
Moreover, the present invention relates to a non-volatile memory apparatus that renews an address conversion table that is stored in a flash EEPROM in units of pages, and manages data to be stored in a flash EEPROM (including data sent from a host computer for reading and writing, as well as data for an address conversion table) in units of blocks each containing a plurality of pages, a method for controlling the non-volatile memory apparatus and a data storage medium that stores a program for controlling the non-volatile memory apparatus.
2. Description of Related Art
Memory cards such as ATA cards and SSFDC cards that are non-volatile memory apparatuses are becoming popular as external memory apparatuses for computers, and standardization of their specification is in progress.
In particular, a memory card according to the PC (Personal Computer) card standard or the PCMCIA (Personal Computer Memory Card International Association) standard operates as an external memory apparatus when connected to a host computer. When removed from the host computer, the memory card can be transferred or transported as a stand-alone unit while maintaining stored data. Even when the host computer is powered on, hot insertions and removals of the memory card can be performed. Because of these advantages, memory cards such as ATA cards are widely used, for example, as means for storing photographic data taken by a digital camera and transferring the data to a host computer.
When the host computer sends a request for writing data in or reading data from a memory card, such as an ATA card or an SSFDC card, an address that stores the data needs to be designated. When the storage location is designated, a set of integers called a logic sector address is used. Logic sector addresses are also used to designate data storage locations when data are read from or written in a hard disk or a floppy disk. A logic sector address is also called as a logic block address.
For example, for accessing a hard disk, a high speed processing can be achieved when data of a relatively large size, for example, 512 bytes of data is processed in one lot. Therefore, 512 bytes of data are treated together as a sector, and reading and writing operations are performed in units of sectors. For designating storage locations in a hard disk, cylinder numbers, head numbers and cluster numbers of the hard disk are used. In order to unify reading and writing processes, storage areas of a hard disk are arranged, virtually, in a line. The storage areas of the hard disk are divided in plural sectors and the sectors are numbered. The numbers are called logic sector addresses. Logic sector addresses can also be defined in a similar manner in the case of a floppy disk.
When a hard disk in a host computer is accessed, logic sector addresses are used for designating data storage locations. Accordingly, it is convenient in terms of development of applications and data management if the same method for designating data storage locations can be used for memory cards such as ATA cards and SSFDC cards. For this reason, the memory cards need to be controlled in such a manner that data storage locations can be designated by using logic sector addresses.
When a memory card is connected to a digital camera, and the digital camera reads data from or writes data in the memory card, logic sector addresses are used to designate data storage locations. In other words, the digital camera operates as a host computer described above.
The memory card has a non-volatile memory apparatus, in particular, a flash EEPROM in its interior. The flash EEPROM has a memory area that is formed from a single block or is divided into a plurality of blocks, and each block is formed from a single page or is divided into a plurality of pages. Each page is structured to have the same unit storage capacity for reading and writing in a hard disk. For example, each page is provided with a memory area that is capable of storing 512 bytes of data. Also, as widely practiced, each page may be provided with an additional storage area of 16 bytes as a redundancy area. Although one page contains 512 bytes in the former structure, and one page contains 528 bytes in the latter structure, both of the structures are common to each other to the extent that they are capable of storing 512 bytes of data.
Storage locations within a flash EEPROM are readily determined by designating chip numbers of chips, block numbers of blocks in the chips, and page numbers of pages in the blocks. Storage areas within a flash EEPROM are arranged, virtually, in a line, and are successively numbered page by page from the head storage area. The numbers are called physical page addresses. In other words, storage locations within a flash EEPROM can be designated by the physical page addresses.
On the other hand, storage areas within a flash EEPROM are arranged, virtually, in a line, and successively numbered in units of blocks from the head storage area. The numbers are called physical block addresses. In other words, storage locations within a flash EEPROM can also be designated by the physical block addresses.
In the present application, designation of storage locations by the physical page addresses or by the physical block addresses is generally called as designation of storage locations by "physical locations".
A flash EEPROM is an electrically erasable programmable read only memory. In other words, in principle, data can be written only once in an electrically erased page. Therefore, when data stored in any one of a plurality of pages is desired to be changed, the data in that page needs to be erased and then new data needs to be written. Further, flash EEPROMs are characterized in that the above-described erase operation is executed in units of blocks in order to reduce the number of devices and to increase the operation speed.
Other types of EEPROMs are equipped with a function of overwriting data in a page that already stores data. However, in most of the EEPROMs having the overwriting function of this type, the number of overwriting operations is limited. Also, there are a lot of other types of EEPROMs, which do not have the overwriting function.
The memory card converts a logic sector address designated by a host computer into a physical location, and performs writing and reading operations with respect to a page that is located at the physical location. However, for example, because of the limitation in the number of overwriting operations, the correspondence between a logic sector address and a physical page address is likely changed very frequently.
Conventionally, a memory card having a flash EEPROM of the type described above may also be equipped with a RAM in addition to the flash EEPROM. The RAM stores an address conversion table for converting a logic sector address into a physical location. When the correspondence between a logic sector address and a physical location is renewed, the address conversion table stored in the RAM is renewed. For example, an address conversion table is realized by an array having indexes defining logic sector addresses and values defining physical locations.
When a host computer issues requests to write data in the same logic sector address multiple times, the flash EEPROM may contain pages that store old data and pages that store new data. The pages that store old data need to be erased at appropriate timing. Therefore, it is necessary to manage page statuses including, for example, a status in which a page has been erased and no data has been written, a status in which a page has data already written and the written data is effective or valid, a status in which a page has data already written but the written data is not effective, and the like. Conventionally, such a status is stored in a redundant area in each page.
When the power to the memory card is turned off, contents of the RAM are erased. Therefore, when the power is turned on, an address conversion table is formed as an initial step. Therefore, correspondences between pages and logic sector addresses need to be stored in the flash EEPROM. Conventionally, a correspondence is stored in a redundant area in each page.
Furthermore, as described above, writing in the flash EEPROM is performed in units of pages, and an erasure is performed in units of blocks each containing a plurality of pages. It typically takes a long time to perform an erasure operation. In accordance with a conventional technique, when data that is stored in a specified page is renewed, an entire block that contains the specified page is temporarily copied onto the RAM, the entire block is erased, a portion that corresponds to the specific page among the data that has been copied onto the RAM is renewed, and the data in the RAM with the specified portion being renewed is returned to and written in the block.
When a memory card is used for a digital camera as an external memory device, the memory card should desirably be capable of saving as many high-resolution photos as possible. Also, in consideration of the convenience in storage and transportation of data, the memory card should desirably have a large amount of storage capacity as much as possible. Furthermore, there is a great demand to further increase the storage capacity of a memory card as the size of data increases as a result of the size of applications becoming greater and multimedia becoming more popular.
Also, according to the PC card standard, the size of memory cards is restricted, and therefore an area to dispose chips is restricted. Accordingly, the memory capacity of RAMs is restricted.
However, according to the conventional method, when the storage capacity of the memory card is made larger, the address conversion table also becomes larger, and the storage capacity of the RAM for storing the address conversion table needs to be made larger. Accordingly, the conventional method creates problems that result in increased costs and increased power consumption.
Also, according to the conventional method, correspondences between management sector addresses and physical locations are distributed and located in plural pages, and address conversion tables are formed in the RAM. As a result, reading operations to read data from numerous pages are required, and it takes a long time to construct an address conversion table. As a consequence, in accordance with the conventional method, a substantially long time elapses from the time the memory card is connected to the host computer until the time the computer is ready for writing data in or reading data from the memory card.
Furthermore, the conventional method suffers from other problems. For example, when a part of pages in a block is renewed, the entire block needs to be erased. Therefore, an erasure operation takes a long time, and it takes a long time to write data in the memory card. Also, if a power outage occurs when data in a block is temporarily stored in the RAM, the data in the block will be lost and cannot be restored.